# -*- coding: utf-8 -*-
import resource

class _NodeType(object):
    """"""
    def __init__(self,name):
        self.__name=name
        
    def name(self):
        return self.__name
    
    def __str__(self):
        return self.__name
    
    def __repr__(self):
        return str(self)

class _FileType(_NodeType):
    def newResource(self,path,workspace):
        return resource.File(path,workspace)

class _DirType(_NodeType):
    def newResource(self,path,workspace):
        return resource.Dir(path,workspace)

class _ProjectType(_NodeType):
    def newResource(self,path,workspace):
        return resource.Project(path,workspace)

class _RootType(_NodeType):
    def newResource(self,path,workspace):
        return resource.RootResource(path,workspace)

FILE      =_FileType('file')
DIR       =_DirType('dir')
PROJECT   =_ProjectType('project')
ROOT      =_RootType('root')

